/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.mallsite.modules.shop.entity;

import org.hibernate.validator.constraints.NotBlank;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 商品品牌Entity
 * @author ruyang
 * @version 2020-12-04
 */
@Table(name="ms_goods_brand", alias="a", columns={
		@Column(name="brand_id", attrName="brandId", label="品牌编码", isPK=true),
		@Column(name="shop_id", attrName="shopId", label="店铺编码"),
		@Column(name="brand_logo", attrName="brandLogo", label="品牌logo"),
		@Column(name="brand_cover", attrName="brandCover", label="品牌封面"),
		@Column(name="brand_initial", attrName="brandInitial", label="品牌首字母"),
		@Column(name="brand_name", attrName="brandName", label="商品品牌名称", queryType=QueryType.LIKE),
		@Column(name="summary", attrName="summary", label="商品品牌摘要"),
		@Column(name="content", attrName="content", label="品牌图文信息"),
		@Column(name="brand_sort", attrName="brandSort", label="商品分类排序"),
		@Column(name="brand_recommend", attrName="brandRecommend", label="品牌推荐，0为否，1为是"),
		@Column(name="brand_apply", attrName="brandApply", label="品牌申请，1为申请中，0为通过，默认为1"),
		@Column(includeEntity=DataEntity.class),
	},joinTable={
			@JoinTable(type=Type.LEFT_JOIN, entity=Shop.class, alias="b",
					on="b.shop_id = a.shop_id",
					columns={
							@Column(name="shop_id", label="商户编码", isPK=true),
							@Column(name="shop_name", label="商户名称", isQuery=false),
				}),
			}, orderBy="a.brand_sort asc"
)
public class GoodsBrand extends DataEntity<GoodsBrand> {
	
	private static final long serialVersionUID = 1L;
	private String brandId;		// 品牌编码
	private String shopId;		// 店铺编码
	private String brandLogo;		// 品牌logo
	private String brandCover;		// 品牌封面
	private String brandInitial;		// 品牌首字母
	private String brandName;		// 商品品牌名称
	private String summary;		// 商品品牌摘要
	private String content;		// 品牌图文信息
	private Integer brandSort;		// 商品分类排序
	private String brandRecommend;		// 品牌推荐，0为否，1为是
	private String brandApply;		// 品牌申请，1为申请中，0为通过，默认为1
	
	private Shop shop;
	
	public GoodsBrand() {
		this(null);
	}

	public GoodsBrand(String id){
		super(id);
	}
	
	public String getBrandId() {
		return brandId;
	}

	public void setBrandId(String brandId) {
		this.brandId = brandId;
	}
	
	public String getShopId() {
		return shopId;
	}

	public void setShopId(String shopId) {
		this.shopId = shopId;
	}
	
	public String getBrandLogo() {
		return brandLogo;
	}

	public void setBrandLogo(String brandLogo) {
		this.brandLogo = brandLogo;
	}
	
	public String getBrandCover() {
		return brandCover;
	}

	public void setBrandCover(String brandCover) {
		this.brandCover = brandCover;
	}
	
	public String getBrandInitial() {
		return brandInitial;
	}

	public void setBrandInitial(String brandInitial) {
		this.brandInitial = brandInitial;
	}
	
	@NotBlank(message="商品品牌名称不能为空")
	public String getBrandName() {
		return brandName;
	}

	public void setBrandName(String brandName) {
		this.brandName = brandName;
	}
	
	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}
	
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	public Integer getBrandSort() {
		return brandSort;
	}

	public void setBrandSort(Integer brandSort) {
		this.brandSort = brandSort;
	}
	
	public String getBrandRecommend() {
		return brandRecommend;
	}

	public void setBrandRecommend(String brandRecommend) {
		this.brandRecommend = brandRecommend;
	}
	
	public String getBrandApply() {
		return brandApply;
	}

	public void setBrandApply(String brandApply) {
		this.brandApply = brandApply;
	}

	public Shop getShop() {
		return shop;
	}

	public void setShop(Shop shop) {
		this.shop = shop;
	}
}